﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="资产编码录入.aspx.cs" Inherits="syc.Jidong.资产编码录入" %>
<html>
<head>
<title></title>
<style type="text/css">
#ShangJi{border:1px solid #dddddd;height:22px;padding-top:2px;font-size:14px;}
</style>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"
 SelectCommand="select @FID=FID,@LV=LV,@名称=名称,@单位=单位,@规格=规格,@折旧年限=折旧年限,@残值率=残值率 from 资产编码 where ID=@ID"
 InsertCommand="insert into 资产编码(ID,FID,LV,名称,单位,规格,折旧年限,残值率)values(@ID,@FID,@LV,@名称,@单位,@规格,@折旧年限,@残值率)"
 UpdateCommand="update 资产编码 set 名称=@名称,单位=@单位,规格=@规格,折旧年限=@折旧年限,残值率=@残值率 WHERE ID=@ID;"
    onselected="SqlDataSource1_Selected">

<SelectParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4" />
<asp:Parameter Name="FID" DbType="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="LV" DbType="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="名称" DbType="String" Size="40" Direction="Output" />
<asp:Parameter Name="单位" DbType="AnsiString" Size="20" Direction="Output" />
<asp:Parameter Name="规格" DbType="AnsiString" Size="40" Direction="Output" />
<asp:Parameter Name="折旧年限" DbType="Byte" Size="1" Direction="Output" />
<asp:Parameter Name="残值率" DbType="Byte" Size="1" Direction="Output" />
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4"/>
<asp:ControlParameter Name="FID" DbType="Int32" Size="4" ControlID="FID" />
<asp:ControlParameter Name="LV" DbType="Int32" Size="4" ControlID="LV" />
<asp:ControlParameter Name="名称" DbType="String" Size="40" ControlID="MingCheng" />
<asp:ControlParameter Name="单位" DbType="AnsiString" Size="20" ControlID="DanWei" />
<asp:ControlParameter Name="规格" DbType="AnsiString" Size="40" ControlID="GuiGe" />
<asp:ControlParameter Name="折旧年限" DbType="Byte" Size="1" ControlID="ZheJiu" />
<asp:ControlParameter Name="残值率" DbType="Byte" Size="1" ControlID="CanZhi" />
</InsertParameters>
<UpdateParameters>
<asp:ControlParameter Name="ID" Type="Int32" Size="4" ControlID="FID" />
<asp:ControlParameter Name="名称" Type="String" Size="40" ControlID="MingCheng" />
<asp:ControlParameter Name="单位" DbType="AnsiString" Size="20" ControlID="DanWei" />
<asp:ControlParameter Name="规格" DbType="AnsiString" Size="40" ControlID="GuiGe" />
<asp:ControlParameter Name="折旧年限" DbType="Byte" Size="1" ControlID="ZheJiu" />
<asp:ControlParameter Name="残值率" DbType="Byte" Size="1" ControlID="CanZhi" />
</UpdateParameters>
</asp:SqlDataSource>

<asp:Label ID="FID" runat="server" Text="" Visible="false"></asp:Label>
<asp:Label ID="LV" runat="server" Text="" Visible="false"></asp:Label>

<div id="wintop" class="wintop" style="display:none;">资产编码录入</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <asp:Button ID="Button_Save" runat="server" Text="保 存" UseSubmitBehavior="false" 
        CssClass="button" onclick="Button_Save_Click"  />
    <input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel">
<table border="1" style="border-collapse:separate;font-size:14px;margin-top:10px;">
<tr>
<td width="100" height="30" style="padding:3px;" align="right">编 码：</td>
<td width="180"><asp:Label ID="ShangJi" runat="server" Text=""></asp:Label><asp:TextBox ID="BianMa" runat="server" Width="40px" CssClass="txt"></asp:TextBox></td>
<td width="100" style="padding:3px;" align="right">名 称：</td>
<td width="180"><asp:TextBox ID="MingCheng" runat="server" Width="160px" CssClass="txt"></asp:TextBox><font color="red">*</font></td>
</tr>
<tr>
<td height="30" style="padding:3px;" align="right">单 位：</td>
<td><asp:TextBox ID="DanWei" runat="server" Width="120px" CssClass="txt"></asp:TextBox></td>
<td style="padding:3px;" align="right">规 格：</td>
<td><asp:TextBox ID="GuiGe" runat="server" Width="160px" CssClass="txt"></asp:TextBox></td>
</tr>
<tr>
<td height="30" style="padding:3px;" align="right">折旧年限：</td>
<td><asp:TextBox ID="ZheJiu" runat="server" Width="80px" CssClass="txt"></asp:TextBox>年</td>
<td style="padding:3px;" align="right">残值率：</td>
<td><asp:TextBox ID="CanZhi" runat="server" Width="80px" CssClass="txt"></asp:TextBox>%</td>
</tr>
</table>
<div style="font-size:14px;line-height:18px;">
<font color=red ><br />提示：</font>
<br />(1) 资产分类编码为大类、中类、小类、小小类4个级别；
<br />(2) 各级别编码为2位数字，取值范围为 01 ～ 99 ；
<br />(2) 4个级别合计8为数字编码，如：14020316 。
<br /><br />
</div>
</asp:Panel>

</form>
<script>
    var notice = '<%=this.Notice %>';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
</script>
<script>
    document.onkeydown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName != "INPUT" || tag.className != "txt") return;
        if (e.keyCode == 13) {
            if (tag.id == "MingCheng") {
                document.getElementById("Button_Save").focus();
                return false;
            }
            e.keyCode = 9;
        }
    }
<%=this.Autorun %>
</script>
</body>
</html>